import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import registerServiceWorker from './registerServiceWorker';
import thunk from './woniu-react-thunk-redux'
import arrayThunk from './woniu-redux-array-thunk'
import App from './App';
import {BrowserRouter as Router,Link,Route,Redirect,Switch} from 'react-router-dom'
import {Provider} from './woniu-react-redux'
// import  {createStore,applyMiddleware,compose} from 'redux'
import  {createStore,applyMiddleware} from './woniu-redux'
import {counter} from './index_redux.js'
import Auth from './Auth'
import Dashboard from './Dashboard'
// import reducers from './reducer'//合并reducer
import  './config.js'
import 'antd-mobile/dist/antd-mobile.css'; 
// import './store'
const store=createStore(counter,applyMiddleware(thunk,arrayThunk))
// const store =createStore(reducers,compose(applyMiddleware(thunk),
// window.devToolsExtension?window.devToolsExtension():()=>{}
// ))

// class Test extends React.Component{
    
//     render(){
//         console.log(this.props)
//         return <h2>骑兵连test{this.props.match.params.location}</h2>
//     }
// }
// store.subscribe(render)
// function render() {
    
    // ReactDOM.render(
        // (<Provider store={store} >
        // <Router>
        // <Switch>
        //         {/* Switch 只渲染命中的第一个route */}
        //         <Route path='/login' exact component={Auth} ></Route>
        //         <Route path='/dashboard' component={Dashboard}></Route>
        //         <Redirect to='/dashboard'></Redirect>
        //     </Switch>
        
        // </Router>
         {/* </Provider>) */}
    // , document.getElementById('root'));
// }
// render()
ReactDOM.render(
    <Provider store={store}>
        <App />
    </Provider>
    , document.getElementById('root')

);
// const add=(x)=>y=>x+y+3;
// const res=add(2)(3)
// console.log(`res is ${res}`)
// const obj={name:'蜗牛',type:'React'}
// console.log(Object.keys(obj))

function sayHello(...args) {//直接把arguments对象转成数组
    // console.log(args instanceof Array)
    // console.log(arguments)
}
sayHello(1,2,3)
registerServiceWorker();
